function save_scalars(myList, filename, suffix, append)

    % Writing scalars in string
    tex_string = '';
    fieldNames = fieldnames(myList);
    for i = 1:length(fieldNames)
        name = fieldNames{i};
        value = num2str(myList.(name)); % Assuming the values are numeric. If they can be strings, you might need to handle differently.
        new_line = sprintf('\\newcommand{\\%s%s}{%s}', name, suffix, value);
        tex_string = sprintf('%s\n%s', tex_string, new_line);
    end

    % Saves it as a .tex file
    if append
        fileID = fopen([filename '.tex'], 'a');
    else
        fileID = fopen([filename '.tex'], 'w');
    end
    fprintf(fileID, '%s', tex_string);
    fclose(fileID);
end
